Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 24, 2025

The README documents a keyword arguments constructor pattern for Unit.new (line 57), but this initialization method lacked test coverage.

Changes

  • Added test coverage for Unit.new(scalar:, numerator:, denominator:) constructor in spec/ruby_units/unit_spec.rb
  • Test verifies scalar value, units string, kind detection, and standard unit properties

Example

# This constructor pattern is now tested:
unit = Unit.new(scalar: 1.5, numerator: ["<meter>"], denominator: ["<second>"])
# => 1.5 m/s (speed)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@olbrich olbrich marked this pull request as ready for review December 24, 2025 17:51
Copilot AI changed the title [WIP] Update clarity improvements and Ruby version Add test coverage for keyword arguments constructor Dec 24, 2025
Copilot AI requested a review from olbrich December 24, 2025 17:53
@olbrich olbrich merged commit c853625 into ruby-3.2-features Dec 24, 2025
1 of 2 checks passed
@olbrich olbrich deleted the copilot/sub-pr-377 branch December 24, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants